Sub t()
    Dim Con As ADODB.Connection
  Dim arr(2 To 25) As String
  Dim q As String
  
  Set Con = New ADODB.Connection
  
  'Con.Open "Driver={MySQL ODBC 5.1 Driver};Server=localhost;OPTION=3", "root", "sophist"
  
    Con.ConnectionString = "Driver={MySQL ODBC 5.1 Driver};" + _
                         "Server=localhost;" + _
                         "DB=sophist;" + _
                         "user=root;" + _
                         "PassWord=sophist;" + _
                         "OPTION=3;"
    
  Con.Open
  
  'Con.Execute "insert into info (name, adddr) values('cindy','shunyi'),('tina','chaoyang')"
   
   q = "insert into info (name, adddr) values "
   a = Array("a", "b", "c", "d")
   For Each i In a
    'MsgBox i
   Next i
  
    Dim ts As Tasks
    
    Set ts = ActiveProject.Tasks
    
    Dim t As Task
    'Set t = ts(1)
    For Each t In ts
        If Not t Is Nothing Then
            
          q = q & "('" & t.Name & "','" & t.Finish & "'),"
          
           MsgBox t.Text3
           
           Exit Sub
          ' MsgBox t.Start
          ' MsgBox t.Finish
          ' MsgBox t.Name
          ' MsgBox t.Duration
          
            
          ' Con.Execute "insert into info (name, adddr) values('" & t.Name & "','" & t.Finish & "')"
            
        End If
    Next t
    'q = Trim(q)
    'q = Left(q, Len(q) - 1)

   ' MsgBox q
    
    
    'Con.Execute q
    
    'MsgBox "success"
End Sub
